package com.zhiyou.test.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhiyou.test.model.AdminModel;
import com.zhiyou.test.service.IAdminService;
@Controller
@RequestMapping("/admin")
public class admincontroller {

	@Autowired
	IAdminService service;
	
	
	@RequestMapping("index")
	public String index(Model model){
		
		List<AdminModel> list=service.queryAdmin();
		
		model.addAttribute("Admin", list);
		return "exam";
	}
	
	
	@RequestMapping("query")
	public String query(Model model){
	
		List<AdminModel> list=service.queryAdmin();
		
		model.addAttribute("Admin", list);
		return "total";
	}
	
	
	
}
